<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input
      type="text"
      value="我是用户名"
      name="username"
      placeholder="请输入用户名"
    />

    <input type="checkbox" name="hobby" id="checkbox" />

    <button type="submit">提交</button>
    <script>
      const unmae = document.querySelector("input");
      // 获取表单的值
      console.log(unmae.value);
      // 设置表单的值
      unmae.value = "我是新用户名";

      const checkbox = document.querySelector("#checkbox");
      console.log(checkbox.checked);
      checkbox.checked = true;

      const btn = document.querySelector("button");
      console.log(btn.disabled);
      btn.disabled = true;
      
    </script>
  </body>
</html>
